home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SAVESCRN.SWG / 0005_SAVE5.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  66 lines

  1. {
  2. >show some help Text or something, and then make it disappear
  3. >without erasing the Text that the Window overlapped.  In other
  4. >Words, there will be a screen full of Text, the Window would open
  5. >up over some Text display whatever message, and disappear, leaving
  6.  
  7. The Text you see displayed on the screen can be captured to a Variable
  8. and subsequently restored through direct screen reads/Writes.  Video
  9. memory is located (on most systems) at $B800 For color and $B000 on
  10. monochrome adapters.  Each screen location consists of two Bytes: 1) the
  11. Foreground/background color of the location, and 2) the Character at the
  12. location.
  13.  
  14. The following Program Writes a screen full of 'Text', captures this
  15. screen to a Variable (VidScreen), Writes over top of the current screen,
  16. then restores original screen stored in VidScreen.
  17. }
  18. Program OverLap;
  19. Uses Crt;
  20.  
  21. Const
  22.   VidSeg = $B800;     {..$B000 For monochrome}
  23.  
  24. Type
  25.   VidArray = Array[1..2000] of Word;
  26.  
  27. Var
  28.   VidScreen : VidArray;
  29.   x : Integer;
  30.  
  31.  
  32. Procedure SetScreenColor(back,Fore : Integer);
  33. begin
  34.   TextBackGround(back);
  35.   TextColor(Fore);
  36. end;
  37.  
  38.  
  39. begin
  40.   SetScreenColor(4,2);                   {.. green on red }
  41.   ClrScr;
  42.   For x := 1 to 25 do
  43.     begin                                {..Write original screen }
  44.     GotoXY(1,x);
  45.     Write('Text Text Text Text Text Text Text Text Text Text Text '+
  46.            'Text Text Text Text Text');
  47.     end;
  48.   readln;                                {..press enter to cont. }
  49.  
  50.   For x := 1 to 2000 do                  {..store current screen in }
  51.     VidScreen[x] := MemW[VidSeg:x];      {  VidScreen Array }
  52.  
  53.   SetScreenColor(7,0);                   {..black on white }
  54.   GotoXY(38,11);
  55.   WriteLn('HELP');                       {..Write help Text, or }
  56.   GotoXY(38,12);                         {  whatever... }
  57.   WriteLn('HELP');
  58.   GotoXY(38,13);
  59.   WriteLn('HELP');
  60.   readln;                                {..press enter to cont. }
  61.  
  62.   For x := 1 to 2000 do                  {..restore VidScreen Array }
  63.     MemW[VidSeg:x] := VidScreen[x];
  64.   readln;
  65. end.
  66.